package tasksManagerWeb;

import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import model.Task;

import com.taskmanager.service.TasksManagerBeanLocal;

@ManagedBean
@SessionScoped
public class TasksBasicView implements Serializable {

	private static final long serialVersionUID = 1L;

	@EJB TasksManagerBeanLocal tasksBean; 

	public List<Task> tasks; 
	
	@PostConstruct
	public void init(){
		tasks = tasksBean.dumpTasks();
	}
	
	public long getTasksCount(){
		return tasksBean.tasksCount();
	}
	
	public List<Task> getTasks() {

		return tasks;
	}
	
}
